import React, {useMemo} from 'react'

interface ModalBodyProps {
  className?: string
  isScroll?: boolean
}

const ModalBody: React.FC<ModalBodyProps> = ({
  className,
  children,
  isScroll = true,
}): React.ReactElement => {
  const renderContent: React.ReactElement = useMemo(() => {
    const classNameResult: string =
      'modal-body modal-body-admin ' +
      (isScroll ? 'custom-scroll ' : ' ') +
      (className ? className : '')
    return <div className={classNameResult}>{children}</div>
  }, [children, className, isScroll])

  return <>{renderContent}</>
}

export {ModalBody}
